package remin;

import javax.swing.*;
import java.awt.*;

public class Upoz extends JFrame {
	
	private static Upoz INSTANCE = null;
	static Dimension dim;
	JLabel uddl,priro;
	
	    private Upoz(){
		
		super("Upozornenie");
		setSize(300,200);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setLayout(null);
		
		dim = Toolkit.getDefaultToolkit().getScreenSize();
		
		JLabel upz = new JLabel("Treba splnit udalost: ",JLabel.CENTER);
		uddl = new JLabel("",JLabel.CENTER);
		uddl.setForeground(new Color(49,85,125));
		JLabel uppr = new JLabel("Jej priorita je:  ",JLabel.CENTER);
		priro = new JLabel("",JLabel.CENTER);
		priro.setForeground(new Color(130,31,17));
		
		
		setBackground(new Color(184,208,209));
		setBounds(dim.width-300, dim.height-230, 300, 200);
		upz.setBounds(50, 20, 200, 20);
		uddl.setBounds(50, 50, 200, 20);
		uppr.setBounds(50,90,200,20);
		priro.setBounds(100, 130, 100, 20);
						
		add(upz);
		add(uddl);
		add(uppr);
		add(priro);
		setVisible(true);
	}
	    
	    public static Upoz getInstance() {
	        if(INSTANCE == null) {
	           INSTANCE = new Upoz();
	           INSTANCE.setVisible(true);
	           //System.out.println("upoz if cycle,getinstance here");
	        }
	        return INSTANCE;
	     }
	    public static void setInstance(){
	    	if(INSTANCE != null){
	    		INSTANCE = null;
	    	}
	    }
	    	    
}
